<?php header('Content-Type: application/json; charset=utf-8');

include_once('../sys/sys.php');
include_once('./178config.php');



$st = $_GET['st'];
if(is_null($st)){$st = 0;}

$array_piclist = array();
	
	$DB->build_query(array(
			'select' 	=> 'id,name,lastupdate,count',
			'from'		=> '178_tags',
			'order'		=> 'lastupdate DESC',
			'where'		=> '1' ,
			'limit'		=> array($st,$listnum)
	));
	$qid = $DB->exec_query();
	$i = 0;
	$str = '{"dat": [';
	while ($row = $DB->fetch_row($qid)) {
		if($row['lastupdate'] <= 0) $row['lastupdate'] = 0;
		$str .= '{"nName": "' . trim($row['name']) . '","upDate": "' . get_date_time($row['lastupdate']) . '","id": "' . SITE_URL_MB . 'mb178/getpicfilespics' .$row['id'] . '.html"},';
		$i++;
	}
	
	$str = substr($str,0,strlen($str) - 1);
	$str .= "]}";

echo $str;



//echo '{"dat": [{"nName": "Tommy","upDate": "Maintz"}]}';



?>
